<?php
class M_HotelType extends Apps_Db_Table_Abstract {
    protected $_name = 'hotel_type';

    //list hotel type
    public function listHotelType() {
        $q = $this->_db
                  ->select()
                  ->from($this->_name, null)
                  ->where('hotel_type.status =? ', M_DbTable_HotelType::STATUS_ACTIVE)
                  ->order('hotel_type.sorting_number ASC')
                  ->columns(array('id'          => 'hotel_type.id'));

        if($this->getLang() == 'en') {
            $q->columns(array('title'          => 'hotel_type.en_title'));
        } else {
            $q->columns(array('title'           => 'hotel_type.title'));
        }
        return $q;
    }
}